package com.hwadee.backend.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.MapSerializer;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDateTime;
import java.util.Map;
import java.util.List;

@Getter
@Setter
@TableName("authorize")
public class Authorize {
    @TableId(type = IdType.AUTO)
    @TableField("id")
    @JsonProperty("authorizationId")
    private int id;

    @TableField("applicant")
    private Integer applicant; // 医生ID（允许为null）

    @TableField("response")
    private Integer response; // 被授权用户ID（允许为null）

    @TableField("status")
    private String status; // 授权状态：pending, approved, rejected

    @TableField("create_time")
    private LocalDateTime createTime;

    @TableField("update_time")
    private LocalDateTime updateTime;

    @TableField(value = "`look`")
    private String look; // 查看权限，存储recordTypes逗号分隔字符串

    @TableField(value = "`delete`")
    private String delete; // 删除权限，存储recordTypes逗号分隔字符串

    @TableField(value = "`update`")
    private String update; // 修改权限，存储recordTypes逗号分隔字符串
}